<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>盘点规则</title>
		<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/list.css"/>
	</head>
	<body>
		<!-- 蓝色背景区域 -->
		<div class="wrap">
			<!-- 白色可用区域 -->
			<div class="canuse">
				<!------ 位置 ------>
	            <p class="contentText local"><span>位置：库存规则管理 > 库存盘点规则 > 添加库存盘点规则</span></p>
	            
	            <!-- 列表区 -->
	            <div class="show_list">
                	<div class="title_operate">
                    	<h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>盘点规则详情</span></h4>
                    	<!-- 操作类型区 -->
                        <div class="operate_area" id="addOperate">
                            <a id="addDetail" onclick="addDetail()" class="bgd_add img_hand">增加</a> 
                            <a id="deleteDetail" onclick="deleteDetail()" class="bgd_delete img_hand">删除</a>
                            <a href="" class="bgd_blue_two img_hand">保存</a> 
                            <a href="checkRuleList.html" class="bgd_white_two img_hand">返回</a> 
                        </div>
                	</div>
                	<div class="list_area">
                        <!-- 信息列表区 -->
                        <div class="info_area">
                        	
                            <table class="tablelist" border="1" cellspacing="0" cellpadding="0">
                                <tbody>
                                    <tr class="menuText list_head">
                                        <th class="checkSelectAll"></th>
                                        <th class="">规则名称</th>
                                        <th class="">仓库</th>
                                        <th class="">盘点周期</th>
                                        <th class="">创建日期</th>
                                        <th class="">盘点人</th>
                                        <th class="">盘点审核人</th>
                                    </tr>
                                </tbody>
                                <tbody class="tablelist" id="addTr1">
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="" id="" value="" /></td>
                                        <td><input type="text" name="" id="" value="" /></td>
                                        <td>
                                        	<select name="" class="selectWidth">
                                        		<option value="">选择仓库</option>
                                        		<option value="">全部仓库</option>
                                        		<option value="">丝网库</option>
                                        		<option value="">湿敏元件库</option>
                                        		<option value="">盘状物料库</option>
                                        		<option value="">图纸库</option>
                                        		<option value="">其它仓库</option>
                                        	</select>
                                        </td>
                                        <td>
                                        	<select name="" class="selectWidth">
                                        		<option value="">按月盘点</option>
                                        		<option value="">按季盘点</option>
                                        		<option value="">按年盘点</option>
                                        	</select>
                                        </td>
                                        <td><input type="text" name="" id="" value="2018-09-26" /></td>
                                        <td>
                                        	<select name="" class="selectWidth">
                                        		<option value="">选择盘点人</option>
                                        		<option value="">库管员</option>
                                        	</select>
                                        </td>
                                        <td>
                                        	<select name="" class="selectWidth">
                                        		<option value="">选择审核人</option>
                                        		<option value="">车间主管</option>
                                        	</select>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
			</div>
			
			<!-- 版尾  -->
			<div class="ending">
				Copyright© 2019-2020 磐基技术有限公司
			</div>
			
		</div>
	</body>
	<script src="../../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		var h = document.documentElement.clientHeight;
		$(".wrap").css("height", h);
		
		// 获取每行 td 的兄弟节点
		$("#addTr1 td").hover(   
			function () {      
				$(this).parent().children().addClass("td_hover");   
			},    
			function () {      
				$(this).parent().children().removeClass("td_hover");   
			}
		);
		
		//-------- 增加明细 ---------
	    function addDetail() {
	        
	        var dom = "<tr class='contentText list_list'><td><input class='input_checkBox' type='checkBox' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><select name='' class='selectWidth'><option value=''>选择仓库</option><option value=''>全部仓库</option><option value=''>丝网库</option><option value=''>湿敏元件库</option><option value=''>盘状物料库</option><option value=''>图纸库</option><option value=''>其它仓库</option></select></td>";
	        dom += "<td><select name='' class='selectWidth'><option value=''>按月盘点</option><option value=''>按季盘点</option><option value=''>按年盘点</option></select></td>";
	        dom += "<td><input type='text' name='' value='2018-09-26'></td>";
	        dom += "<td><select name='' class='selectWidth'><option value=''>选择盘点人</option><option value=''>库管员</option></select></td>";
	        dom += "<td><select name='' class='selectWidth'><option value=''>选择审核人</option><option value=''>车间主管</option></select></td></tr>";
	        
	        $("#addTr1").append(dom);
	    }
		
		//-------- 删除明细 ---------
	    function deleteDetail() {
	        var checks = $("input[type='checkbox']:checked");
	        if (checks.length == 0) {
	            $("#addTr1").find("tr:last").remove();
	        } else {
	            $.each(checks, function(item, obj) {
	                $(obj).parent().parent().remove();
	            });
	        }
	    }
	</script>
</html>
